package com.sayimo.maker.user.service.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sayimo.framework.exception.DaoException;
import com.sayimo.framework.exception.ServiceException;
import com.sayimo.maker.user.dao.StartupGameDetailInterfaceDao;
import com.sayimo.maker.user.service.StartupGameDetailService;
import com.sayimo.maker.user.vo.StartupGameDetail;


@Service(value= "startupGameDetailService")
public class StartupGameDetailServiceImpl implements StartupGameDetailService {

	private static Log logger = LogFactory.getLog(StartupGameDetailServiceImpl.class);
	 
	@Autowired
	private StartupGameDetailInterfaceDao startupGameDetailInterfaceDao;
	
	@Override
	public Integer insertStartupGameDetail(StartupGameDetail startupGameDetail) throws ServiceException {
		try {
			int result =startupGameDetailInterfaceDao.insertStartupGameDetail(startupGameDetail);
			return result;
		} catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
		
	}

	public StartupGameDetailInterfaceDao getStartupGameDetailInterfaceDao() {
		return startupGameDetailInterfaceDao;
	}

	public void setStartupGameDetailInterfaceDao(StartupGameDetailInterfaceDao startupGameDetailInterfaceDao) {
		this.startupGameDetailInterfaceDao = startupGameDetailInterfaceDao;
	}

	@Override
	public List<StartupGameDetail> selectStartupGameDetailById(Integer teamId) throws ServiceException {
		try {
			List<StartupGameDetail> list =startupGameDetailInterfaceDao.selectStartupGameDetailById(teamId);
			return list;
		} catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
	}

	@Override
	public int updateStartupGameDetail(StartupGameDetail startupGameDetail) throws ServiceException {
		try {
			int result =startupGameDetailInterfaceDao.updateStartupGameDetail(startupGameDetail);
			return result;
		} catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
	}

}
